import { defineConfig } from 'vitepress'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  title: 'Jvyou UI',
  head: [['link', { rel: 'icon', href: '/favicon.ico' }]],
  description: '由 Vite 和 Vue 驱动的通用组件库',
  rewrites: {
    'packages/jvyou-ui/src/:comp/(.*)': 'components/:comp/(.*)',
    'packages/utils/src/:comp/(.*)': 'utils/:comp/(.*)',
    'packages/utils/src/index.md': 'utils/index.md',
    'docs/(.*)': '(.*)',
  },
  themeConfig: {
    // https://vitepress.dev/reference/default-theme-config
    logo: '/logo.svg',
    outline: 'deep',
    nav: [
      { text: '首页', link: '/' },
      { text: '开发指南', link: '/guide/install' },
      { text: '组件', link: '/components/button/' },
      { text: '工具', link: '/utils/' },
    ],
    footer: {
      message: 'Made by Jvyou Team with ❤️ Jvyou',
      copyright: 'Copyright © 2023-present Jvyou',
    },
    sidebar: {
      '/components/': [
        {
          text: '基础组件',
          items: [
            { text: 'JButton 按钮', link: '/components/button/' },
          ],
        },
        {
          text: '表单组件',
          items: [{ text: 'JInput 输入框', link: '/components/input/' }],
        },
        {
          text: '数据组件',
          items: [{ text: 'JTable 表格', link: '/components/table/' }],
        },
        {
          text: '反馈组件',
          items: [{ text: 'JTooltip 文字提示', link: '/components/tooltip/' }],
        },
      ],
      'utils': [
        { text: '指南', items: [{ text: '快速开始', link: '/utils/' }] },
        {
          text: '核心功能',
          items: [
            { text: 'useClassnames', link: '/utils/gen-classnames/' },
          ],
        },
      ],
      'guide': [
        {
          text: '开发指南',
          items: [
            { text: '安装', link: '/guide/install' },
            { text: '快速开始', link: '/guide/getting-started' },
          ],
        },
      ],
    },
    socialLinks: [
      { icon: 'github', link: 'https://gitee.com/jvyou/jvyou-ui' },
    ],
  },
})
